<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="text" placeholder="姓名" id="d1">
<input type="text" placeholder="工资" id="d2">
<input type="text" placeholder="工作" id="d3">
<input type="button" value="添加" onclick="f()">
<table border="1">
  <caption>员工列表</caption>
  <tr>
    <th>姓名</th>
    <th>工资</th>
    <th>工作</th>
  </tr>
</table>
<script>
 let d1  = document.querySelector("#d1")
  let d2 = document.querySelector("#d2")
  let d3 = document.querySelector("#d3")
  function f(){
    let tr = document.createElement("tr")
    let  n = document.createElement("td")
    let s = document.createElement("td")
    let w = document.createElement("td")
    n.innerText= d1.value;
    s.innerText=d2.value;
    w.innerText=d3.value;
    tr.append(n,s,w)
    let table  = document.querySelector("table");
   table.append(tr)
  }
</script>
</body>
</html>